CPU 686
BITS 32

%define DATA_REG 0x60
%define EOI 0x20
%define PIC1_CMD 0x20

global _kbd_isr
global _scancode

section .data

_scancode dd 0


section .text

_kbd_isr:
	push eax
	
	xor eax, eax
	in al, DATA_REG
	mov dword[_scancode], eax
		
	cmp eax, 0
	je fim
	
fim:
	mov al, EOI
	out PIC1_CMD, al

	pop eax
	iretd
END